import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/Login.vue'
// 主页
import ZhuYe from '../views/ZhuYe.vue'
// 头部
import Header from '../components/Nav/Header.vue'
// 内容
import Boday from '../components/Boday/Body.vue'
// 内容里面的子路由
import Look from '../components/LookZhang/Look.vue'
// 添加文章的组件
import Add from '../components/AddZhang/add.vue'
// 详情文章的组件
import Detail from '@/components/Detail/detail.vue'
// 共同的组件
import Finger from '@/components/LoginZi/Finger.vue'
// 精彩图片组件
import Beautiful from '@/components/Beautiful/beautiful.vue'
// 文章热门的展示
import ReMen from '@/components/Detail/Remen/ReMen.vue'
// 空组件
import Ko from '@/components/Detail/Remen/Ko.vue'
// 评论组件
import Pinglun from '@/components/Detail/PingLun/pinglun.vue'
const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/zhuYe',
    name: 'ZhuYe',
    component: ZhuYe,
    // 重定向到指定的子路由
    redirect:'/look',
    children:[
      {
        path:'/look',
        name:'Look',
        component:Look
      },
      {
        path:'/add',
        name:'Add',
        component:Add
      }
    ]
  },
  {
    path: '/header',
    name: 'Header',
    component: Header
  },
  {
    path: '/boday',
    name: 'Boday',
    component: Boday
  },
  {
    path:'/detail',
    name:'Detail',
    component:Detail
  },
  {
    path:'/finger',
    name:'Finger',
    component:Finger
  },
  {
    path:'/beautiful',
    name:'Beautiful',
    component:Beautiful
  },
  {
    path:'/reMen',
    name:'ReMen',
    component:ReMen
  },
  {
    path: '/Ko',
    name: 'Ko',
    component:Ko
  },
  {
    path: '/Pinglun',
    name: 'Pinglun',
    component: Pinglun
  }

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
